﻿using System.IO;

namespace OpenLS.Spreadsheet.Formats.Biff.Records
{
    internal abstract class CFExTemplateParams
    {
        public abstract byte Type { get; }

        public abstract byte Length { get; }
        public abstract void Read(BinaryReader reader);

        public static CFExTemplateParams Create(CFTemplate icfTemplate)
        {
            switch (icfTemplate)
            {
                case CFTemplate.Filter:
                    return new CFExFilterParams();
                case CFTemplate.ContainsText:
                    return new CFExTextTemplateParams();
                case
                    CFTemplate.Today:
                    return new CFExDateTemplateParams();
                case
                    CFTemplate.Tomorrow
                    :
                    return new CFExDateTemplateParams();
                case
                    CFTemplate.Yesterday
                    :
                    return new CFExDateTemplateParams();
                case
                    CFTemplate.Last7Days
                    :
                    return new CFExDateTemplateParams();
                case
                    CFTemplate.LastMonth:
                    return new CFExDateTemplateParams();
                case
                    CFTemplate.NextMonth
                    :
                    return new CFExDateTemplateParams();
                case
                    CFTemplate.ThisWeek
                    :
                    return new CFExDateTemplateParams();
                case
                    CFTemplate.NextWeek
                    :
                    return new CFExDateTemplateParams();
                case
                    CFTemplate.LastWeek
                    :
                    return new CFExDateTemplateParams();
                case
                    CFTemplate.ThisMonth
                    :
                    return new CFExDateTemplateParams();
                case
                    CFTemplate.AboveAverage
                    :
                    return new CFExAveragesTemplateParams();
                case
                    CFTemplate.BelowAverage
                    :
                    return new CFExAveragesTemplateParams();
                case
                    CFTemplate.AboveOrEqualToAverage
                    :
                    return new CFExAveragesTemplateParams();
                case
                    CFTemplate.BelowOrEqualToAverage
                    :
                    return new CFExAveragesTemplateParams();
                default:
                    return new
                        CFExDefaultTemplateParams();
            }
        }

        public abstract void Write(BinaryWriter writer);
    }
}